package com.member.common.enums;


import lombok.Getter;

import java.util.Objects;

/**
 * @author wangxin
 */
@Getter
public enum CollectionTypeEnum {
    /**
     * 商品
     */
    GOOD(10, "商品"),
    /**
     * 素材
     */
    MATERIAL(20, "素材"),

    /**
     * 图片
     */
    IMAGE( 30, "图片"),

    /**
     * 视频
     */
    VIDEO( 40, "视频"),

    /**
     * 文件
     */
    FILE( 50, "文件"),
    ;

    private final Integer key;
    private final String desc;

    CollectionTypeEnum(Integer key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public static CollectionTypeEnum getByKey(Integer key){
        for (CollectionTypeEnum item : CollectionTypeEnum.values()){
            if(Objects.equals(item.getKey(), key)){
                return item;
            }
        }
        return null;
    }

}
